import request from '@/utils/request'

// 根据pid查询分类列表
export const GetCategoriesByPid = pid => {
  return request({
    url: `/admin/product/category/findByPid/${pid}`,
    method: 'get',
  })
}

export const DeleteCategoryById = id => {
  return request({
    url: `/admin/product/category/deleteById/${id}`,
    method: 'DELETE',
  })
}

export const GetCategoryById = id => {
  return request({
    url: `/admin/product/category/getByCategoryId/${id}`,
    method: 'GET',
  })
}

export const UpdateCategoryById = category => {
  return request({
    url: `/admin/product/category/updateById`,
    method: 'put',
    data: category,
  })
}
export const ExportCatesExcel = () => {
  return request({
    url: `/admin/product/category/export`,
    method: 'get',
    responseType: 'blob',
  })
}
